import React, { useState } from 'react'
import Navigator from './Navigator'
// import naviData from './data/naviData'
import naviOther from './data/naviOther'
import dataConverter from './data/dataConverter'
import './index.css';
function WrapNavigator (props) {
  // useEffect(() => {
  // }, [])
  const naviData = window.naviData
  window.naviDataList = dataConverter(naviData)
  const [pageData, setPageData] = useState(naviData)
  const dataList = [
    naviData,
    naviOther
  ]
  function onChange (index) {
    setPageData(dataList[parseInt(index)])
  }
  return (
    <Navigator class="navigatorMainClass"
      pageData={pageData}
      onChange={onChange}
    ></Navigator>
  )
}
export default WrapNavigator